package com.ren.model;

public class ListItem {
    private String text;
    private boolean completed;

    public ListItem() {
        this.completed = false;
    }

    public ListItem(String text) {
        this.text = text;
        this.completed = false;
    }

    public ListItem(String text, boolean completed) {
        this.text = text;
        this.completed = completed;
    }

    // Getters and Setters
    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public boolean isCompleted() {
        return completed;
    }

    public void setCompleted(boolean completed) {
        this.completed = completed;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        ListItem listItem = (ListItem) obj;
        return completed == listItem.completed &&
                java.util.Objects.equals(text, listItem.text);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(text, completed);
    }
}
